<?php
/**
 * Moduleadmin_Data_Addmodule
 * add module form data
 *
 * @author Adrian Stolarski
 */
class Moduleadmin_Data_Addmodule implements Moduleadmin_Data_Mainable, 
        Moduleadmin_Data_Templatable, Moduleadmin_Data_Tokenable{
    
    /**
     *
     * @var type $random_token
     * random token handler
     */
    public $random_token;
    
    /**
     * create_token()
     * create anti-csrf token
     * 
     * @return type $random_token
     */
    public function create_token() {
        $this->random_token = new Core_Data_Tokenizer;
        return $this->random_token->create_token();
    }
    
    /**
     * get_template_name()
     * get current template name
     * 
     * @return string $template
     */
    public function get_template_name() {
       $template = SERVER_ROOT."moduleadmin/views/addmodule.php";
       return $template;
    }
    
    /**
     * main()
     * add module template data
     * 
     * @param array $variables
     * @return type
     */
    public function main(array $variables = null) {
        $page = array();
        $page['template'] = $this->get_template_name();
        $page['csrf_token'] = $this->create_token();
        //var_dump($page);
        //die();
        return $page;
    }

}
